Doors date to Unix timestamp

Hi,

I am working on a program to export a view into a text format. For the export, I iterate objects and columns within a view. The DXL script works fine. But, the time format in the export is German format e.g. "Donnerstag, 31. Januar 2008". I need to get a timestamp in the export.

So, how should I find if a column in based on Attribute Type "Date"?

Is there any API to covert date into UNIX timestamp? I found locale to convert german format into the US format.
SystemAdmin - Tue Sep 08 09:59:39 EDT 2009

Re: Doors date to Unix timestamp
Peter_Albert - Tue Sep 08 10:26:39 EDT 2009

This code fragment loops through the columns of the current view and shows which displayed attributes are of type Date. For those attributes and the current object, the UNIX timestamp is calculated and printed.

(AttrDef ad).typeName is used to identify the attribute type

The 'intOf (Date d)' perm is used to calculate the UNIX timestamp.

Regards,

Peter
 

Module currMod = current Module
Object obj
Column col
string colAttName
string colTitle
Date thisDate
int thisUnixTimestamp
AttrDef ad
if (!null currMod)
{ // Current Module is not null
  obj = current Object
  for col in currMod do
  { // Loop through columns in current view
    colTitle = title(col)
    colAttName = attrName(col)
    if (!null colAttName)
    { // Column displays attribute
      ad = find(current Module, colAttName)
      if (ad.typeName == "Date")
      { // Attribute of type date
        print "Column '" colTitle "' displays '" colAttName "' of type Date\n"
        if (!null obj)
        { // Current object is not null
          thisDate = obj.colAttName
          thisUnixTimestamp = intOf thisDate
          print "The current value is " thisDate " [" thisUnixTimestamp "]\n"
        } // Current object is not null
      } // Attribute of type date
    } // Column displays attribute
  } // Loop through columns in current view
} // Current Module is not null